package com.atguigu.gmall.order.service;

import com.atguigu.gmall.model.enums.ProcessStatus;
import com.atguigu.gmall.model.order.OrderInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

public interface OrderService extends IService<OrderInfo> {
    Long saveOrderInfo(OrderInfo orderInfo);

    String getTradeNo(String userId);

    Boolean checkTradeNo(String tradeNo,String userId);

    void delTradeNo(String userId);

    Boolean checkStock(Long skuId, Integer skuNum);

    //IPage<OrderInfo> getMyOrderList(Page<OrderInfo> orderInfoPage, String userId);
    IPage<OrderInfo> getMyOrderList(Page<OrderInfo> orderInfoPage, String userId,String orderStatus);

    void execExpiredOrder(Long orderId);

    OrderInfo getOrderInfo(Long orderId);

    public void updateOrderStatus(Long orderId, ProcessStatus processStatus);

    void sendOrderMsg(Long orderId);
    //将orderInfo转换为map
    Map wareJson(OrderInfo orderInfo);
    //拆单
    List<OrderInfo> orderSplit(String orderId, String wareSkuMap);

    void execExpiredOrder(Long orderId, String flag);
}
